package com.qidianit.mes.md.controller;

import com.qidianit.common.pojo.MESResult;
import com.qidianit.mes.md.service.SIPService;
import com.qidianit.mes.pojo.SIP;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 奇幻夜之梦
 * @Company 起点编程
 * @Description
 * @Time 2024/10/24 10:17
 */
@RestController
@CrossOrigin
@RequestMapping("/material")
public class SIPController {
    @Autowired
    private SIPService sipService;
    @GetMapping("/listSIP")
    public MESResult selectByPage(Long sipMaterialId,
                                  @RequestParam(defaultValue = "1")int page,
                                  @RequestParam(defaultValue = "10")int limit){
        // 这里只有一行代码，直接调用service，不处理任何业务
        return sipService.selectByPage(sipMaterialId,page,limit);
    }

    @PostMapping("/saveSIP")
    public MESResult save(@RequestBody SIP sip) {
        return  sipService.save(sip);
    }
}

